body {
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
}
.box-item {
  height: 100%;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: white;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.1);
  transition: all 0.5s;
}
.box-item.active {
  flex: 3;
}
.box-item.active p {
  transform: translateY(0) !important;
}
.box-item p {
  font-size: 24px;
  flex: 1;
  transition: all 0.5s;
}
.box-item p.top {
  transform: translateY(-120%);
}
.box-item p.bottom {
  transform: translateY(120%);
}
.middle {
  font-size: 36px;
  font-weight: bold;
}
.panel1 {
  background-image: url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500);
}
.panel2 {
  background-image: url(https://source.unsplash.com/rFKUFzjPYiQ/1500x1500);
}
.panel3 {
  background-image: url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d);
}
.panel4 {
  background-image: url(https://source.unsplash.com/ITjiVXcwVng/1500x1500);
}
.panel5 {
  background-image: url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500);
}
